﻿@model IEnumerable<Model.Entities.UserVehicle>

@{
    ViewBag.Title = ViewRes.SharedResource.TitleMyVehicles;
}

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
         <th>
            Fotos
        </th>
        <th>
            ShortDesc
        </th>
        <th>
            Year
        </th>
        <th>
            State
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @if (item.Images.Count > 0)
            {
                <img class="small_img" src='@Html.Raw(item.Images.First().Path)' />
            }
            else
            {
                <img class="small_img" src="../../Content/images/no_photo.jpg"/>
            }
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ShortDesc)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Year)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.State)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id = item.UserVehicleID }) |
            @Html.ActionLink("Details", "Details", new { id = item.UserVehicleID }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.UserVehicleID })
        </td>
    </tr>
}

</table>
